from django.db import models
from subjects_app.models import Subject  # 导入Subject模型

class Content(models.Model):
    title = models.CharField(max_length=100)
    subject = models.ForeignKey(Subject, on_delete=models.CASCADE)  # 关联到Subject模型
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    file_path = models.CharField(max_length=100)

    def __str__(self):
        return self.title

    class Meta:
        db_table = 't_content'
